Reverse the order of the itemsΒΆ

A.reverse()

Reverse the order of the items in the array.

from array import *

AI = array('i', [1, 3, 5, 3, 7, 1, 9, 3])
print("Original array: " + str(AI))
# Original array: array('i', [1, 3, 5, 3, 7, 1, 9, 3])

AI.reverse()

print("Reverse the order of the items:")
print(str(AI))
# array('i', [3, 9, 1, 7, 3, 5, 3, 1])

See also: https://www.w3resource.com/python-exercises/array/python-array-exercise-3.php